home *** CD-ROM | disk | FTP | other *** search
/ The Complete Multimedia B…e & 1,000 Bible Clip Art / The Complete Multimedia Bible & 1,000 Bible Clip Art.iso / INSTALL / BIBLE.MST < prev    next >
Text File  |  1994-10-24  |  33KB  |  1,116 lines

  1. '*******************************************************************
  2. '*
  3. '*    DESCRIPTION: Compton's The Complete Multimedia Bible
  4. '*
  5. '*    AUTHOR:      Hal Grogan et al
  6. '*
  7. '*    HISTORY:     09/04/94 Created
  8. '*
  9. '*******************************************************************
  10. '**************************************************************************
  11. '*        The Complete Multimedia Bible AND Video For Windows 1.1
  12. '**************************************************************************
  13. '$DEFINE DEBUG  ''Define for script development/debugging
  14. '$INCLUDE 'setupapi.inc'
  15. '$INCLUDE 'msdetect.inc'
  16.  
  17.  
  18. ''Dialog ID's
  19. CONST WELCOME       =  100
  20. CONST ASKQUIT       =  200
  21. CONST ASKQUIT1      =  201
  22. CONST ASKQUIT2      =  202
  23. CONST ASKEXISTSDIR  =  210
  24. CONST ASKEXISTSPROD =  220
  25. CONST ASKEXISTSWIN  =  230
  26. CONST DESTPATH      =  300
  27. CONST EXITFAILURE   =  400
  28. CONST EXITQUIT      =  600
  29. CONST EXITSUCCESS   =  700
  30. CONST EXITSUCCESSVFW=  701
  31. CONST EXITSUCCESSNMS=  702
  32. CONST PRODHELP      =  900
  33. CONST SIGNBOARD1    = 2001
  34. CONST SIGNBOARD2    = 2002
  35. CONST SIGNBOARD3    = 2003
  36. CONST SIGNBOARD4    = 2004
  37. CONST SIGNBOARD5    = 2005
  38. CONST SIGNBOARD6    = 2006
  39. CONST CUSTINST      = 6200
  40. CONST TOOBIG        = 6300
  41. CONST BADPATH       = 6400
  42. CONST MINREQUIRED   = 6500
  43. CONST RESTART       = 7900
  44. CONST RESTARTII     = 8000
  45.  
  46.  
  47.  
  48. ''Bitmap IDs
  49. CONST IDC_BM0       = 600
  50. CONST IDC_BM1       = 601
  51. ''Icon IDs
  52. CONST IDC_ICON0                 =       500
  53. CONST IDC_ICON1                 =       501
  54.  
  55.  
  56. ''File Types
  57. CONST PROD    = 1
  58. CONST VID     = 2
  59. CONST NMS     = 3
  60.  
  61. '' actual amount plus 10%
  62. CONST PRODCOST = 10793413
  63. CONST VIDCOST  = 2329118
  64. CONST NMSCOST  = 5640255
  65.  
  66. CONST DISPLAYPATHLEN = 40 '' Length limit for display of path in Custom Installation
  67.  
  68. GLOBAL CUIDLL$
  69.  
  70. GLOBAL szSaveCieDir$
  71. GLOBAL SrcDir$
  72.  
  73. GLOBAL WinDir$
  74. GLOBAL WinSysDir$
  75.  
  76. GLOBAL DEST$        '' Default destination directory.
  77. GLOBAL WINDRIVE$    '' Windows drive letter.
  78.  
  79. GLOBAL szFound$            '' found filespec
  80.  
  81. ''CustInst list symbol names
  82. GLOBAL PRODFILES$
  83. GLOBAL VIDFILES$
  84. GLOBAL NMSFILES$
  85.  
  86. '' already installed booleans
  87. GLOBAL bCieInstalled%
  88. GLOBAL bVfwInstalled%
  89. GLOBAL bNmsInstalled%
  90.  
  91. GLOBAL cost&
  92. GLOBAL cost1&
  93. GLOBAL free&
  94. GLOBAL free1&
  95.  
  96. GLOBAL CursorSave%
  97.  
  98. ''Dialog list symbol names
  99. GLOBAL CHECKSTATES$
  100. GLOBAL STATUSTEXT$
  101. GLOBAL DRIVETEXT$
  102. GLOBAL REQUIREDTEXT$
  103. GLOBAL HDLIST$
  104. GLOBAL INSTALLTEXT$
  105.  
  106. '' defined functions
  107. DECLARE SUB AddOptFilesToCopyList (ftype%)
  108. DECLARE SUB RecalcOptFiles (ftype%)
  109. DECLARE SUB RecalcPath
  110. DECLARE SUB SetDriveStatus
  111. DECLARE FUNCTION MakePath(szDir$, szFile$) AS STRING
  112. DECLARE SUB CheckForPROD(szPRODDir$)
  113. Declare Function TruncateToLengthOrLess(szSrcStr$, nLength%) As String
  114. Declare Function GetProcessor() As Integer
  115. Declare Function MeetsMinRequired() As Integer
  116. Declare Function RemoveSlash (szDir$) As String
  117. Declare Function MakeDirPath (szDir$) As String
  118. Declare Function CheckForDateVersion(szFile$, szDate$, szVersion$) As String
  119. Declare Sub ModifyIniVFW 
  120. Declare Sub InstallProdGroup
  121. Declare Sub ModifyIniAnimation
  122.  
  123. '' external procedures
  124. Declare Function MaximizeWindow LIB "mscuistf.dll" (hwnd%) As Integer
  125. Declare Function DoMemManInfo LIB "mscuistf.dll" (item%) As Integer
  126. Declare Function SetTo256Min LIB "mscuistf.dll" () As Integer
  127. Declare Function GetVerInfo LIB "mscuistf.dll" (szPath$, szVer$, Product%) As Integer
  128. Declare Function DoVFWIniFiles LIB "mscuistf.dll" () As Integer
  129.  
  130. DECLARE FUNCTION GetModuleHandle LIB "kernel" (szModName$) AS INTEGER
  131. DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
  132. DECLARE FUNCTION ExitWindowsExec  LIB "User" (Exec$, Param$) AS INTEGER
  133. Declare Function sndPlaySound Lib "MMSystem" (lpsound As Any, flag As Integer) As Integer
  134. Declare Function waveOutGetNumDevs Lib "MMSystem" () As Integer
  135. Declare Function GetDC Lib "User" (hWnd%) As Integer
  136. Declare Function GetDeskTopWindow Lib "User" () As Integer
  137. Declare Function GetDeviceCaps Lib "GDI" (hDC%, nIndex%) As Integer
  138. DECLARE FUNCTION GetPrivateProfileString LIB "Kernel" (lpApplicationName As String, lpKeyName As String, lpDefault As String, lpReturnedString As String, nSize As Integer, lpFileName As String) As Integer
  139. Declare Function GlobalCompact Lib "kernel" (flag&) As Long
  140. Declare Function GetFreeSpace Lib "kernel" (flag%) As Long
  141. Declare Function GetFreeSystemResources Lib "User" (fuSysResource As Integer) As Integer
  142. Declare Function ReleaseDC Lib "User" (hWnd As Integer, hDC As Integer) As Integer
  143.  
  144. Const SM_MOUSEPRESENT = 19
  145.  
  146.  
  147. INIT:
  148.     szSaveCieDir$      = ""
  149.  
  150.   ''Disk cost list symbols
  151.   PRODFILES$   = "Cie"
  152.   VIDFILES$    = "VfW Runtime"
  153.   NMSFILES$    = "NMS Files"
  154.  
  155.   CUIDLL$ = "mscuistf.dll"            '' custom user interface dll
  156.   HELPPROC$ = "FHelpDlgProc"          '' Help dialog procedure
  157.  
  158.   hwnd% = HwndFrame()
  159.   i% = MaximizeWindow(hwnd%)              '' maximize the main window
  160.  
  161.   SetBitmap CUIDLL$, IDC_BM0 '' comptons logo
  162.   SetTitle "The Complete Multimedia Bible"
  163.  
  164.   szTmp$ = GetSymbolValue("STF_SRCINFPATH")
  165.   szInf$ = GetSymbolValue("STF_SRCINFPATH")
  166.   IF szInf$ = "" THEN
  167.     szInf$ = GetSymbolValue("STF_CWDDIR") + "BIBLE" + ".INF"
  168.   END IF
  169.   ReadInfFile szInf$
  170.  
  171.   SrcDir$ = GetSymbolValue("STF_SRCDIR")
  172.  
  173.   WinDir$     = GetWindowsDir()
  174.   WinSysDir$  = GetWindowsSysDir()
  175.  
  176.   '' set same drive windows is on as default
  177.   WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
  178.   DEST$ = WINDRIVE$ + ":\" + "BIBLE95"
  179.  
  180.  
  181.   '' see if the Bible is running
  182.   IF GetModuleHandle("BIBLE") > 0 THEN
  183.     i% = DoMsgBox("Compton's is currently running."+chr$(13)+"Please exit the program and rerun Setup.","Setup", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  184.         END
  185.   END IF
  186.  
  187.  
  188.   ''CustInst list symbols
  189.   CHECKSTATES$ = "CheckItemsState"
  190.   STATUSTEXT$  = "StatusItemsText"
  191.   DRIVETEXT$   = "DriveStatusText"
  192.     REQUIREDTEXT$ = "MinRequiredText"
  193.     HDLIST$       = "HdList"
  194.     INSTALLTEXT$  = "InstallItemsText"
  195.  
  196.   '' for each section of inf file
  197.   FOR i% = 1 TO 3 STEP 1
  198.     AddListItem STATUSTEXT$, ""
  199.     AddListItem CHECKSTATES$, "ON"
  200.         AddListItem INSTALLTEXT$, "(Required)"
  201.   NEXT i%
  202.     ReplaceListItem INSTALLTEXT$, 3, "(Speed Enhancement)"
  203.     
  204.   '' for the display in custinst
  205.   FOR i% = 1 TO 7 STEP 1
  206.     AddListItem DRIVETEXT$, ""
  207.     AddListItem REQUIREDTEXT$, ""
  208.   NEXT i%
  209.  
  210.     bCieInstalled% = 0
  211.     bVfwInstalled% = 0
  212.     bNmsInstalled% = 0
  213.  
  214.   '' means the message box will allow error to be ignored if file size does not match with inf file
  215.   i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  216.  
  217.  
  218. WELCOME:
  219.   sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", PRODHELP, HELPPROC$)
  220.   IF sz$ = "CONTINUE" THEN
  221.     UIPop 1
  222.   ELSE
  223.     GOSUB ASKQUIT
  224.     GOTO WELCOME
  225.   END IF
  226.  
  227.     i% = MeetsMinRequired()
  228.     If i% = 0 Then
  229.  
  230. MINREQUIRED:
  231.   sz$ = UIStartDlg(CUIDLL$, MINREQUIRED, "FMinReqDlgProc", PRODHELP, HELPPROC$)
  232.   IF sz$ = "CONTINUE" THEN
  233.     UIPop 1
  234.   ELSE
  235.     GOSUB ASKQUIT
  236.     GOTO MINREQUIRED
  237.   END IF
  238.     End If
  239.  
  240.   '' see if the product has been installed before
  241.   szDir$ = GetIniKeyString("WIN.INI", "BIBLE95", "PATH")
  242.   IF szDir$ <> "" THEN
  243.     DEST$ = MID$(szDir$,1,LEN(szDir$)-1)
  244.     CheckForPROD(szDir$)
  245.   ELSE
  246.     '' no entry in win.ini should we look for other versions
  247.     '' I say no!
  248.   END IF
  249.  
  250.     '' check for correct version of Video for Windows
  251.   CursorSave% = ShowWaitCursor()
  252.     szVFW$ = CheckForDateVersion("MSVIDEO.DLL", "1994-07-01", "1.10.0.187")
  253.     Select Case szVFW$
  254.         Case "NOT FOUND"
  255.           '' set windows drive and windows directory as default for VFW
  256.           szVFW$ = RemoveSlash(WinDir$)
  257.         Case "INCORRECT"
  258.             szVFW$ = MakeDirPath(szFound$)
  259.         Case Else
  260.           ReplaceListItem CHECKSTATES$, 2, ""
  261.           ReplaceListItem INSTALLTEXT$, 2, "(Already Installed)"
  262.     End Select
  263.  
  264. CUSTINST:
  265.  
  266.   '' destination path
  267.   ''Truncate display if too long.
  268.   IF LEN(DEST$) > DISPLAYPATHLEN THEN
  269.         ReplaceListItem DRIVETEXT$, 7, TruncateToLengthOrLess(DEST$, DISPLAYPATHLEN)
  270.   ELSE
  271.         ReplaceListItem DRIVETEXT$, 7, DEST$
  272.   END IF
  273.   RecalcPath
  274.   SetDriveStatus
  275.  
  276.   sz$ = UIStartDlg(CUIDLL$, CUSTINST, "F